#include "Arduino.h"
#include "key.h"

void KEY_init(void)
{
   pinMode(4, INPUT);
   pinMode(5, INPUT);
   pinMode(8, INPUT);
   pinMode(9, INPUT);
   pinMode(13, INPUT);
}

uint8_t KEY_get()
{
   uint8_t key = 0;
   if (digitalRead(5) == LOW)
   {
      key = 2;
   }

   else if (digitalRead(8) == LOW)
   {
      key = 3;
   }

   else if (digitalRead(9) == LOW)
   {
      key = 4;
   }

   return key;
}
